<!doctype html>
<html>
	<head>
		<meta name="layout" content="main">
		<title>${retreatInstance?.name ?: 'Unknown Retreat'}</title>
	</head>
	<body>
		<div class="content" role="main">
			<h1>${retreatInstance?.name ?: 'Unknown Retreat'}</h1>
			<g:if test="${flash.message}">
				<div class="message" role="status">${flash.message}</div>
			</g:if>
			
			<ol class="property-list tabbed-bottom">
				<g:if test="${retreatInstance?.description}">
					<li class="fieldcontain tabbed-bottom">
						<p class="article" aria-labelledby="description-label"><g:fieldValue bean="${retreatInstance}" field="description"/></p>
					</li>
				</g:if>
				
				<g:if test="${retreatInstance?.theme}">
					<li class="fieldcontain">
						<span id="theme-label" class="property-label"><g:message code="retreat.theme.label" default="Theme" /></span>
						<span class="property-value" aria-labelledby="theme-label"><g:fieldValue bean="${retreatInstance}" field="theme"/></span>
					</li>
				</g:if>
				
				<g:if test="${retreatInstance?.themeVerses}">
					<li class="fieldcontain">
						<span id="themeVerses-label" class="property-label"><g:message code="retreat.themeVerses.label" default="Theme Verse(s)" /></span>
						<span class="property-value">
							<g:each in="${retreatInstance.themeVerses}" var="verses">
								<retreat:passage passage="${verses}" />
							</g:each>
						</span>
					</li>
				</g:if>
				
				<g:if test="${retreatInstance?.startDate}">
					<li class="fieldcontain">
						<span id="startDate-label" class="property-label"><g:message code="retreat.startDate.label" default="Start Date" /></span>
						<span class="property-value" aria-labelledby="startDate-label"><putils:formatDate date="${retreatInstance?.startDate}" /></span>
					</li>
				</g:if>
			
				<g:if test="${retreatInstance?.endDate}">
					<li class="fieldcontain">
						<span id="endDate-label" class="property-label"><g:message code="retreat.endDate.label" default="End Date" /></span>
						<span class="property-value" aria-labelledby="endDate-label"><putils:formatDate date="${retreatInstance?.endDate}" /></span>
					</li>
				</g:if>
			
				<g:if test="${retreatInstance?.location}">
					<li class="fieldcontain">
						<span id="location-label" class="property-label"><g:message code="retreat.location.label" default="Location" /></span>
						<span class="property-value" aria-labelledby="location-label">
							<retreat:location location="${retreatInstance.location}" />
						</span>
					</li>
				</g:if>
				
				<g:if test="${retreatInstance?.cost}">
					<li class="fieldcontain">
						<span id="location-label" class="property-label"><g:message code="retreat.cost.label" default="Cost" /></span>
						<span class="property-value" aria-labelledby="location-label">
							<g:formatNumber number="${retreatInstance.cost}" type="currency" currencyCode="USD" />
						</span>
					</li>
				</g:if>				
				
				<g:if test="${retreatInstance?.transportationLegs}">
					<li class="fieldcontain tabbed-top tabbed-bottom">
						<span id="transportationLegs-label" class="property-label"><g:message code="retreat.transportationLegs.label" default="Transportation" /></span>
						<span class="property-value" aria-labelledby="transportationLegs-label">
							<retreat:transportationLegs legs="${retreatInstance.transportationLegs}"/>
						</span>
					</li>
				</g:if>
				
				<g:if test="${retreatInstance?.activities}">
					<li class="fieldcontain">
						<span id="transportationLegs-label" class="property-label"><g:message code="retreat.activities.label" default="Activities" /></span>
						<p class="property-value article tabbed-bottom">${retreatInstance.activities}</p>
					</li>
				</g:if>
				
				<g:if test="${retreatInstance?.audience}">
					<li class="fieldcontain">
						<span class="property-label"><g:message code="retreat.audience.label" default="Who can come?" /></span>
						<p class="property-value article tabbed-bottom">${retreatInstance.audience}</p>
					</li>
				</g:if>
				
				<g:if test="${retreatInstance?.whatToBring}">
					<li class="fieldcontain">
						<span class="property-label"><g:message code="retreat.whattobring.label" default="What to bring?" /></span>
						<p class="property-value article tabbed-bottom">${retreatInstance.whatToBring}</p>
					</li>
				</g:if>
				
				<g:if test="${retreatInstance?.whatNotToBring}">
					<li class="fieldcontain">
						<span class="property-label"><g:message code="retreat.whatnottobring.label" default="What not to bring?" /></span>
						<p class="property-value article tabbed-bottom">${retreatInstance.whatNotToBring}</p>
					</li>
				</g:if>
				
				<g:if test="${retreatInstance?.notes}">
					<li class="fieldcontain">
						<span class="property-label"><g:message code="retreat.notes.label" default="Final Notes" /></span>
						<p class="property-value tabbed-bottom">${retreatInstance.notes}</p>
					</li>
				</g:if>
			</ol>
			
			<g:if test="${retreatInstance?.lastUpdated}">
				<div class="left caption spaced-left spaced-bottom">
					<span id="lastUpdated-label" class="property-label"><g:message code="retreat.lastUpdated.label" default="Last Updated" /> </span>
					<span class="property-value" aria-labelledby="lastUpdated-label"><putils:formatDate date="${retreatInstance?.lastUpdated}" /></span>
				</div>
				<div class="clear"></div>
			</g:if>
			
			<g:form>
				<fieldset class="buttons center">
					<g:hiddenField name="id" value="${retreatInstance?.id}" />
					<g:link class="edit" action="register" id="${retreatInstance?.id}"><g:message code="default.button.register.label" default="Register" /></g:link>
					<sec:ifAnyGranted roles="ROLE_ADMIN, ROLE_DIRECTOR">
						<g:link class="list" action="registrations" id="${retreatInstance?.id}"><g:message code="default.button.registrations.label" default="Registrations" /></g:link>
						<g:link class="edit" action="edit" id="${retreatInstance?.id}"><g:message code="default.button.edit.label" default="Edit" /></g:link>
						<%--
							// Delete currently incomplete. Would leave orphan records in database.
							<g:actionSubmit class="delete" action="delete" value="${message(code: 'default.button.delete.label', default: 'Delete')}" onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure?')}');" />
						--%>
					</sec:ifAnyGranted>
				</fieldset>
			</g:form>
		</div>
	</body>
</html>
